package answer2;

import java.io.IOException;

public class HttpTest {
    public static void main(String[] args) throws IOException {
        String url = "http://localhost:8801";
        String url2 = "http://localhost:8801/test";
        HttpStrategy httpClientDemo = new HttpClientDemo();
        HttpStrategy okHttpDemo = new OkHttpDemo();
        HttpContext httpContext1 = new HttpContext(httpClientDemo);
        HttpContext httpContext2 = new HttpContext(okHttpDemo);
        System.out.println("------------------HttpClient调用-----------------------");
        httpContext1.get(url);
        httpContext1.get(url2);
        System.out.println("------------------OkHttp调用-----------------------");
        httpContext2.get(url);
        httpContext2.get(url2);
    }
}
